<?php

class Zend_View_Helper_Slider extends Zend_View_Helper_Abstract {

    protected $options = array(
        'class' => '',
        'items' => array(),
    );

    public function slider($options = array()) {

        $options = array_merge($this->options, $options);
        $r = '<ul id="slider">';
        $rdots = '<ul id="slider-nav" class="fr">';

        if (sizeof($options['items']) == 0)
            return;
        foreach ($options['items'] as $key => $item) {

            $item['short'] = strip_tags($item['short'], '<img>');
            $r .= '<li class="slider-item item' . $item['id'] . '' . ($item['isDefault'] == 1 ? ' active' : '') . '">
                ' . ($item['title'] != "" ? '<div class="slider-item-title"><span class="wrap">' . $item['title'] . '</span></div>' : '') . '
            ' . $item['short'] . '           
            </li>';
            $rdots .= '<li class="slider-nav-item ' . ($item['isDefault'] == 1 ? ' active' : '') . '">
            <a href="javascript:void(0);" rel="nav' . $item['id'] . '">&nbsp;</a>
            </li>';
        }

        $rdots .= '<li class="cls"></li>
            </ul>';
        $r .= '<li class="cls"></li>
            </ul><div class="cls"></div>';

        return $rdots . '' . $r;
    }

}